package com.application.fabric.users.controller;


import com.application.fabric.test.AOPtets;
import com.application.fabric.users.config.HDFS.HadoopTemplate;
import com.application.fabric.users.entity.ExtractToken;
import com.application.fabric.users.entity.Usermessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
@EnableAspectJAutoProxy
@RequestMapping("/testres")
public class testhttpres {
//    @Autowired
//    private TestAccount test;


    @CrossOrigin
    @GetMapping("prf")
    public Map<String, Object> Usermange(@RequestBody Usermessage usermessage) {
        /*尝试去连接网络*/
        System.out.println( usermessage.getIv());
        Map<String, Object> map = new HashMap();
        map.put("code", 200);
        map.put("msg", "验证成功");
        return map;
    }

    @Autowired
    private HadoopTemplate hadoopTemplate;
    @GetMapping("hdfs")
    public Map<String, Object> hdfs() throws Exception {
        /*尝试去连接hdfs*/
        Boolean flag = hadoopTemplate.existDir("/existingevidence",false);
        System.out.println(flag);
        Map<String, Object> map = new HashMap();
        map.put("code", 200);
        map.put("msg", "验证成功");
        return map;
    }


}
